package com.tp7567.web.common;

import org.apache.wicket.Application;
import org.apache.wicket.devutils.debugbar.DebugBar;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.panel.EmptyPanel;
import org.apache.wicket.model.IModel;

public class BasePage extends WebPage {
	
	public BasePage() {
		this(null);
	}
	
	public BasePage(IModel<?> model) {
		super(model);
		
		if (displayDebugBar()) {
			DebugBar debugBar = new DebugBar("debug");
			debugBar.setVisible(Application.DEVELOPMENT.equals(Application.get().getConfigurationType()));
			add(debugBar);
		} else {
			add(new EmptyPanel("debug"));
		}
	}
	
	protected Boolean displayDebugBar() {
		return false;
	}
}
